package com.boc.ewr.util.file.enumeration;


import lombok.extern.slf4j.Slf4j;

import java.util.Arrays;
import java.util.Optional;

/**
 * 智能催收客户反馈标签
 */
@Slf4j
public enum CusmFdbkTagEnum {
    UNABLEOOPERATE("1", "库-不会操作"),
    REPROCESSING("2", "库-U盾要重办"),
    THREETIMES("33", "三次未接通"),
    HANGUP("32", "开场白挂断"),
    DEPART("31", "对账人已离职"),
    BILLNOUSE("22", "通知账单-账户未使用"),
    BILLREFUSE("21", "通知账单-拒绝"),
    DEPARTMENTREFUSE("12", "核对单位-拒绝"),
    DEPARTMENTNOSELF("11", "核对单位-非本人"),
    COMPLAINT("05", "库-欲投诉"),
    CANCELLATION("03", "库-已销户"),
    LIAR("04", "库-质疑骗子");

    private String index;
    private String value;

    CusmFdbkTagEnum(String index, String value) {

        this.index = index;
        this.value = value;
    }

    /**
     * 根据value获取枚举对象
     *
     * @param val
     * @return
     */
    public static CusmFdbkTagEnum getIndexByValue(String val) {
        Optional<CusmFdbkTagEnum> first = Arrays.stream(CusmFdbkTagEnum.values()).filter(e -> e.getValue().equals(val)).findFirst();
        CusmFdbkTagEnum expEnum = first.orElse(null);
        log.info("选择的枚举类型是：" + expEnum.toString());
        return expEnum;
    }

    public String getIndex() {
        return index;
    }

    public void setIndex(String index) {
        this.index = index;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
